import request from '@/utils/request';

const handlerName = 'Organization';
export async function query(params) {
  return request(`/api/${handlerName}/GetList`, {
    method: 'POST',
    data: params,
  });
}
export async function treeDataQuery(params) {
  return request(`/api/${handlerName}/GetTreeData`, {
    method: 'POST',
    data: params,
  });
}
export async function companyTreeDataQuery(params) {
  return request(`/api/${handlerName}/GetCompanyTreeData`, {
    method: 'POST',
    data: params,
  });
}
export async function exportExcel(params) {
  return request(`/api/${handlerName}/export`, {
    method: 'POST',
    data: params,
  });
}
export async function get(params) {
  return request(`/api/${handlerName}/Get`, {
    method: 'Get',
    params: { ...params },
  });
}
export async function add(params) {
  return request(`/api/${handlerName}/Post`, {
    method: 'POST',
    data: { ...params },
  });
}
export async function update(params) {
  return request(`/api/${handlerName}/Put`, {
    method: 'PUT',
    data: { ...params },
  });
}
export async function remove(params) {
  return request(`/api/${handlerName}/Delete`, {
    method: 'DELETE',
    data: { ...params },
  });
}
export async function statusChange(params) {
  return request(`/api/${handlerName}/statusChange`, {
    method: 'PUT',
    data: { ...params },
  });
}

export async function getRoleTreeSelectData(params) {
  return request(`/api/Role/GetSelectData`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getOrganizationTreeSelectData(params) {
  return request(`/api/${handlerName}/GetTreeSelectData`, {
    method: 'GET',
    params: { ...params },
  });
}
export async function getDepartmentTreeSelectData(params) {
  return request(`/api/${handlerName}/GetDepartmentTreeSelectDataByCompanyId`, {
    method: 'GET',
    params: { ...params },
  });
}
export async function getExtend(params) {
  return request(`/api/Organization/GetExtend`, {
    method: 'GET',
    params: { ...params },
  });
}
export async function putExtend(params) {
  return request(`/api/Organization/PutExtend`, {
    method: 'PUT',
    data: { ...params },
  });
}
